package cqut;

public class bite {
    public static int s(int x)
    {
        if (x<10)
            return  x;
        else {
            int y=x%10;
            x=x/10;
            return y+s(x);
        }
    }

    public static void main(String[] args) {
        bite bi=new bite();
        int ret=bi.s(1729);
        System.out.println(ret);
    }
    public static void main5(String[] args) {
        bite bit=new bite();
        int y=bit.su(7);
        System.out.println(y);
    }
    public static int su(int x){
        if(x==1)
            return 1;
        else
            return 2*su(x-1)+1;
    }
    public static void main3(String[] args) {
        bite bit=new bite();
        int c=bit.max3(7,8);
        double o=bit.max3(7,9,10.5);
        System.out.println(c+"  "+o);
    }
    public static int max3(int x,int y)
    {
        if (x>y)
            return x;
        else
            return y;
    }
    public static double max3(double x,double y,double z) {
        double[] a={x,y,z};
        double max=0;
        for (int i = 0; i <3 ; i++) {
           if(max<a[i]){
               max=a[i];
           }
        }
        return max;
    }

    public static int sum(int x,int y)
    {
        return x+y;
    }
    public static double sum(double x,double y,double z)
    {
        return x+y+z;
    }

    public static void main2(String[] args) {
        bite bi=new bite();
        int ret=bi.sum(8,9);
        double ret1=sum(20,30.5,49.2);
        System.out.println(ret1+"  "+ret);

    }
    public static int  max2(int x, int y){
        if (x>y)
            return x;
        else
        return y;
    }
    public static int  max3(int x, int y,int z){
        int ret=max2(x,y);
        int ret1=max2(ret,z);

        return ret1;
    }
    public static void main1(String[] args) {
      bite bi=new bite();
      int a=bi.max2(2,3);
      int b=bi.max3(4,5,8);
        System.out.println(a+"   "+b);
    }
}
